<template>
	<view class="content">
		<view class="warp1">
			<view class="height-box">
				<view @touchstart="minusH" @touchend="endAddH" @click="cMinusH">
					<image src="../../../../static/icon/my_module/height_w/minusH.png" style="width: 120rpx;height: 120rpx;"></image>
				</view>
				<view class="center-box">
					<view class="height-img">
						<image src="../../../../static/icon/my_module/height_w/height.png"
						style="width: 120rpx;height: 120rpx;"></image>
					</view>
					<view class="text-title">身高</view>
					<view class="content-height">{{valueH}}cm</view>
				</view>
				<view @touchstart="addH" @touchend="endAddH" @click="cAddH">
					<image src="../../../../static/icon/my_module/height_w/addH.png"
					style="width: 120rpx;height: 120rpx;"></image>
				</view>
			</view>
			<view class="weight-box">
				<view @touchstart="minusW" @touchend="endAddH" @click="cMinusW">
					<image src="../../../../static/icon/my_module/height_w/minusW.png"
					style="width: 120rpx;height: 120rpx;"></image>
				</view>
				<view class="center-box-w">
					<view class="weight-img">
						<image src="../../../../static/icon/my_module/height_w/weight.png"
						style="width: 120rpx;height: 120rpx;"></image>
					</view>
					<view class="text-title">体重</view>
					<view class="content-weight">{{valueW}}kg</view>
				</view>
				<view @touchstart="addW" @touchend="endAddH" @click="cAddW">
					<image src="../../../../static/icon/my_module/height_w/addW.png"
					style="width: 120rpx;height: 120rpx;"></image>
				</view>
			</view>
		</view>
		<view class="btn-box">
			<view @click="jump(0)" class="btn-box">
				<bigBtn :btnBoxWidth="btnBoxWidthL" :btnBoxHeight="btnBoxHeightL" :btnColor="btnColorL"
					:btnImgSrc="btnImgSrcL" :btnText="btnTextL" :btnTextColor="btnTextColorL"
					:btnTextSize="btnTextSizeL" :btnImgWidth="btnImgWidthL" :btnRadius="btnRadiusL">
				</bigBtn>
			</view>
			<view @click="jump(1)" class="btn-box">
				<bigBtn :btnBoxWidth="btnBoxWidthR" :btnBoxHeight="btnBoxHeightR" :btnColor="btnColorR"
					:btnImgSrc="btnImgSrcR" :btnText="btnTextR" :btnTextColor="btnTextColorR"
					:btnTextSize="btnTextSizeR" :btnImgWidth="btnImgWidthR" :btnRadius="btnRadiusR">
				</bigBtn>
			</view>
		</view>
	</view>
</template>

<script>
	import bigBtn from '@/components/bigButton.vue';
	export default {
		components: {
			bigBtn
		},
		data() {
			return {
				valueH:160,
				valueW:50,
				showH:false,
				showW:false,
				dataH: [],
				dataW: [],
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				imgH: "../../../../static/icon/my_module/healthInfo/height.png",
				imgW: "../../../../static/icon/my_module/healthInfo/weight.png",
				list: [1, 2, 3, 4, 5, 6],

				btnBoxWidthL: 300,
				btnBoxHeightL: 300,
				btnColorL: "#FD6D62",
				btnImgSrcL: "../../../../static/icon/my_module/healthInfo/LBack.png",
				btnTextL: "上一步",
				btnTextColorL: "#ffffff",
				btnTextSizeL: 30,
				btnImgWidthL: 90,
				btnRadiusL: 140,

				btnBoxWidthR: 300,
				btnBoxHeightR: 300,
				btnColorR: "#FD6D62",
				btnImgSrcR: "../../../../static/icon/my_module/healthInfo/RBack.png",
				btnTextR: "下一步",
				btnTextColorR: "#ffffff",
				btnTextSizeR: 30,
				btnImgWidthR: 90,
				btnRadiusR: 140,
				Tid:0,
			}
		},
		onLoad() {
		},
		methods: {
			addH(){
				var me=this;
				this.Tid=setInterval(function(){
					console.log(me.valueH);
					me.valueH++;
				},100)
			},
			cAddH(){
				this.valueH++;
			},
			endAddH(){
				console.log("asassa");
				clearInterval(this.Tid)
			},
			minusH(){
				var me=this;
				this.Tid=setInterval(function(){
					console.log(me.valueH);
					me.valueH--;
				},100)
			},
			cMinusH(){
				this.valueH--;
			},
			addW(){
				var me=this;
				this.Tid=setInterval(function(){
					console.log(me.valueH);
					me.valueW++;
				},100)
			},
			cAddW(){
				this.valueW++;
			},
			minusW(){
				var me=this;
				this.Tid=setInterval(function(){
					console.log(me.valueH);
					me.valueH--;
				},100)
			},
			cMinusW(){
				this.valueW--;
			},
			jump(index) {
				let me=this;
				let data={};
				if (index == 1) {
					data=uni.getStorageSync("tempHealth");
					data = data ? data : {};
					data.height=me.valueH;
					data.weight=me.valueW;
					console.log(data.height,data.weight)
					uni.setStorageSync("tempHealth",data);
					
					uni.navigateTo({
						url: '../surgery-time/surgery-time'
					})
				}else{
					uni.navigateBack({
						delta:1
					})
				}
			}
		}
	}
</script>

<style>
	@import url("info-height-w.css");
</style>
